<template>
  <formitem-wapper :formitem="formitem">
    <j-month
      :placeholder="placeholder"
      v-bind="getAttrs()"
      :trigger-change="true"
      :getCalendarContainer="getModalAsContainer"
      v-decorator="[formitem.key,formitem.fieldDecoratorOptions]"
    >
    </j-month>
  </formitem-wapper>
</template>

<script>
import JMonth from '@/components/jeecg/JMonth.vue'
import FormitemWapper from '../FormitemWapper.vue'
import { FormItemMixin } from '../FormItenMixin'

export default {
  name: 'MonthWidget',
  mixins: [FormItemMixin],
  components: {
    JMonth,
    FormitemWapper
  },
  methods: {
    getAttrs() {
      const curWidgetAttr = this.widgetAttrs
      if (!curWidgetAttr) {
        return {
          style: {
            width: '100%'
          }
        }
      } else {
        return {
          style: {
            width: '100%'
          },
          readOnly: !(!curWidgetAttr.disabled),
          ...curWidgetAttr
        }
      }
    }
  }
}
</script>

<style scoped>

</style>
